home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / progrmng / cmlmcmpw.sit / Caml Light / Lib / signal.mli < prev    next >
Encoding:
Text File  |  1991-05-01  |  985 b   |  27 lines  |  [TEXT/MPS ]

  1. (* Operations on Unix signals. *)
  2.  
  3. (* Action taken on receipt of a signal: *)
  4.  
  5. type signal_handler =
  6.     Signal_default                      (* Default behavior for the signal *)
  7.   | Signal_ignore                       (* Ignore the signal *)
  8.   | Signal_raise of exn                 (* Raise the given exception value
  9.                                            when the signal occurs. *)
  10. ;;
  11.  
  12. value SIGHUP : int                      (* The "hang up" signal *)
  13.   and SIGINT : int                      (* The "break" signal *)
  14.   and SIGFPE : int                      (* The "arithmetic error" signal *)
  15. ;;
  16.  
  17. value set_signal : int -> signal_handler -> unit = 2 "set_signal"
  18.         (* "set_signal n h" sets the action taken on receipt of signal n
  19.            to h. *)
  20. ;;
  21. value protect : ('a -> 'b) -> 'a -> 'b
  22.         (* "protect f x" applies f to x and returns the result,
  23.            ignoring all signals during the evaluation of f x.
  24.            Useful to implement atomic actions. *)
  25. ;;
  26.  
  27.